package com.lenovo.lcdm.dcm.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lenovo.lcdm.dcm.dto.ReferencedProductInLastYearDto;
import com.lenovo.lcdm.dcm.dto.PortfolioOfferingQueryDto;
import com.lenovo.lcdm.dcm.dto.PortfolioOfferingQueryOptionsDto;
import com.lenovo.lcdm.dcm.entity.PortfolioOffering;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;
import java.util.Set;

/**
* @author sunby1
* @description 针对表【integration_portfolio_offering】的数据库操作Service
* @createDate 2024-01-18 10:43:45
*/
public interface PortfolioOfferingService extends IService<PortfolioOffering> {

    /**
     * 查询同步过来的portfolio offering数据中product segment,business segment,business unit,brand, form factor,category各自的值的集合
     * @return
     */
    PortfolioOfferingQueryOptionsDto getAllQueryOptions();

    /**
     * 获取portfolio_offering表中指定列的distinct值
     * @param columnName
     * @return
     */
    Set<String> getDistinctColumnOptions(String columnName);

    /**
     * 查询同步过来的portfolio offering列表
     * @return
     */
    List<PortfolioOffering> getPortfolioOfferingList(Page page, PortfolioOfferingQueryDto dto);

    /**
     * 根据product offering name查询Referenced Product In Last Year和Referenced CTO In Last Year（多个逗号拼接）
     * @param productOfferingNames
     * @return
     */
    List<ReferencedProductInLastYearDto> getReferencedProductInLastYear(List<String> productOfferingNames);

    /**
     * 根据productOfferingName查找所有Referenced Cto
     * @param productOfferingName
     * @return
     */
    List<String> getReferencedCtoByProductName(String productOfferingName);

    /**
     * 查询同步过来的所有offering的name集合
     * @return
     */
    List<String> getAllPortfolioOfferingName();

    List<PortfolioOffering> fetchUserListByUsername(String username);
}
